{% extends "templates/web.html" %}

{% block title %}NextJia系统架构图{% endblock %}

{% block head_include %}
<style>
.architecture-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.architecture-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.architecture-header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 300;
}

.architecture-header p {
    margin: 10px 0 0 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.diagram-section {
    margin-bottom: 50px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.section-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.section-header h2 {
    margin: 0;
    color: #495057;
    font-size: 1.8rem;
    font-weight: 500;
}

.section-header p {
    margin: 8px 0 0 0;
    color: #6c757d;
    font-size: 1rem;
}

.diagram-grid {
    display: grid;
    gap: 20px;
    padding: 20px;
}

.main-architecture {
    grid-template-columns: 1fr;
}

.module-architecture {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.diagram-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.diagram-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.diagram-card h3 {
    background: #007bff;
    color: white;
    margin: 0;
    padding: 15px 20px;
    font-size: 1.2rem;
    font-weight: 500;
}

.diagram-image {
    position: relative;
    overflow: hidden;
}

.diagram-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.diagram-card:hover .diagram-image img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.diagram-card:hover .image-overlay {
    opacity: 1;
}

.zoom-icon {
    color: white;
    font-size: 2rem;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 20px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #6c757d;
}

.breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .architecture-container {
        padding: 10px;
    }
    
    .architecture-header h1 {
        font-size: 2rem;
    }
    
    .module-architecture {
        grid-template-columns: 1fr;
    }
    
    .diagram-card h3 {
        padding: 12px 15px;
        font-size: 1.1rem;
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 1200px;
    max-height: 90%;
    object-fit: contain;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #bbb;
}
</style>
{% endblock %}

{% block page_content %}
<div class="architecture-container">
    <!-- 面包屑导航 -->
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="/app">首页</a></li>
            <li class="breadcrumb-item active" aria-current="page">系统架构图</li>
        </ol>
    </nav>

    <!-- 页面标题 -->
    <div class="architecture-header">
        <h1>NextJia系统架构图</h1>
        <p>全面了解NextJia ERP系统的整体架构和各模块设计</p>
    </div>

    <!-- 主架构图部分 -->
    <div class="diagram-section">
        <div class="section-header">
            <h2>🏗️ 系统主架构</h2>
            <p>NextJia ERP系统的整体架构设计，展示各个组件之间的关系和数据流向</p>
        </div>
        <div class="diagram-grid main-architecture">
            <div class="diagram-card">
                <h3>NextJia主架构图</h3>
                <div class="diagram-image">
                    <img src="/assets/theme/images/NextJia主架构图/主架构图.JPG" 
                         alt="NextJia主架构图" 
                         onclick="openModal(this)">
                    <div class="image-overlay">
                        <span class="zoom-icon">🔍</span>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 模块架构图部分 -->
    <div class="diagram-section">
        <div class="section-header">
            <h2>📦 业务模块架构</h2>
            <p>各个业务模块的详细架构设计，包括数据流程和业务逻辑</p>
        </div>
        <div class="diagram-grid module-architecture">
            <div class="diagram-card">
                <h3>💰 会计模块</h3>
                <div class="diagram-image">
                    <img src="/assets/theme/images/NextJia模块架构图/会计模块.JPG" 
                         alt="会计模块架构图" 
                         onclick="openModal(this)">
                    <div class="image-overlay">
                        <span class="zoom-icon">🔍</span>
                    </div>
                </div>
            </div>
            
            <div class="diagram-card">
                <h3>📦 库存模块</h3>
                <div class="diagram-image">
                    <img src="/assets/theme/images/NextJia模块架构图/库存模块.JPG" 
                         alt="库存模块架构图" 
                         onclick="openModal(this)">
                    <div class="image-overlay">
                        <span class="zoom-icon">🔍</span>
                    </div>
                </div>
            </div>
            
            <div class="diagram-card">
                <h3>🏭 生产模块</h3>
                <div class="diagram-image">
                    <img src="/assets/theme/images/NextJia模块架构图/生产模块.JPG" 
                         alt="生产模块架构图" 
                         onclick="openModal(this)">
                    <div class="image-overlay">
                        <span class="zoom-icon">🔍</span>
                    </div>
                </div>
            </div>
            
            <div class="diagram-card">
                <h3>🛒 采购模块</h3>
                <div class="diagram-image">
                    <img src="/assets/theme/images/NextJia模块架构图/采购模块.JPG" 
                         alt="采购模块架构图" 
                         onclick="openModal(this)">
                    <div class="image-overlay">
                        <span class="zoom-icon">🔍</span>
                    </div>
                </div>
            </div>
            
            <div class="diagram-card">
                <h3>💼 销售模块</h3>
                <div class="diagram-image">
                    <img src="/assets/theme/images/NextJia模块架构图/销售模块.JPG" 
                         alt="销售模块架构图" 
                         onclick="openModal(this)">
                    <div class="image-overlay">
                        <span class="zoom-icon">🔍</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 图片放大模态框 -->
<div id="imageModal" class="modal">
    <span class="close" onclick="closeModal()">&times;</span>
    <img class="modal-content" id="modalImage">
</div>

<script>
function openModal(img) {
    var modal = document.getElementById("imageModal");
    var modalImg = document.getElementById("modalImage");
    modal.style.display = "block";
    modalImg.src = img.src;
}

function closeModal() {
    var modal = document.getElementById("imageModal");
    modal.style.display = "none";
}

// 点击模态框背景关闭
window.onclick = function(event) {
    var modal = document.getElementById("imageModal");
    if (event.target == modal) {
        modal.style.display = "none";
    }
}

// ESC键关闭模态框
document.addEventListener('keydown', function(event) {
    if (event.key === 'Escape') {
        closeModal();
    }
});
</script>
{% endblock %}